package week_home_work02;

/**
 * @author zdl
 * @date 2024/11/23
 */
public class Demo86 {
    public static void main(String[] args) {
        //输出1到1000之间所有的水仙花数。
        for (int i = 1; i <= 1000; i++) {
            int sum = 0;
            int temp = i;
            while (i != 0) {
                int lastNum = i % 10;
                sum = sum + lastNum * lastNum * lastNum;
                i /= 10;
            }
            i = temp;
            if (sum == temp) {
                System.out.print(temp + "\t");
            }
        }
    }
}
